package cn.yerly.sakura.dao.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
/**
 * 订单详情
 * @author yerly
 *
 */
@Entity
public class OrderItem {
	@Id
	private Long id;
	@ManyToOne
	private User user;
	
	@ManyToOne
	@JoinColumn(name="order_id")
	private Order order;
	@ManyToOne
	private Item item;
	@ManyToOne
	private ItemInfo itemInfo;
	@ManyToOne
	private ItemSpec itemSpec;
	private Double itemPrice;
	private Double totalPrice;
	private Integer quantity;
	private Date ctime;
	private Boolean disabled;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public Item getItem() {
		return item;
	}

	public void setItem(Item item) {
		this.item = item;
	}

	public ItemInfo getItemInfo() {
		return itemInfo;
	}

	public void setItemInfo(ItemInfo itemInfo) {
		this.itemInfo = itemInfo;
	}

	public ItemSpec getItemSpec() {
		return itemSpec;
	}

	public void setItemSpec(ItemSpec itemSpec) {
		this.itemSpec = itemSpec;
	}

	public Double getItemPrice() {
		return itemPrice;
	}

	public void setItemPrice(Double itemPrice) {
		this.itemPrice = itemPrice;
	}

	public Double getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(Double totalPrice) {
		this.totalPrice = totalPrice;
	}

	public Integer getQuantity() {
		return quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	public Date getCtime() {
		return ctime;
	}

	public void setCtime(Date ctime) {
		this.ctime = ctime;
	}

	public Boolean getDisabled() {
		return disabled;
	}

	public void setDisabled(Boolean disabled) {
		this.disabled = disabled;
	}

	@Override
	public String toString() {
		return "OrderItem [id=" + id + ", user=" + user + ", order=" + order
				+ ", item=" + item + ", itemInfo=" + itemInfo + ", itemSpec="
				+ itemSpec + ", itemPrice=" + itemPrice + ", totalPrice="
				+ totalPrice + ", quantity=" + quantity + ", ctime=" + ctime
				+ ", disabled=" + disabled + "]";
	}

}
